package com.oversea.service.impl;

import org.hibernate.Query;
import com.oversea.models.Major;
import com.oversea.models.Majortype;
import com.oversea.service.MajortypeService;

public class MajortypeServiceImpl extends CommonServiceImpl<Majortype> implements
		MajortypeService {

	public Major getMajorByName(String name) {
		String hql = "from Majortype where deleted = ? and MajortypeName like '%"
				+ name + "'%";
		Query query = getSession().createQuery(hql);
		query.setBoolean(0, false);
		query.setString(1, name);
		return (Major) query.uniqueResult();
	}
}




